const Koa = require('koa');
const app = new Koa()
const config = require('./config');
const router = require('./routes');
const bodyParser = require('koa-bodyparser');
const cors = require('koa2-cors');
//解析请求体
app.use(bodyParser())
app.use(cors())
//~这个东西好像就是应该放在最后
app.use(router.routes())




app.listen(config.port, () => {
  console.log(`server is started at port ${config.port}`);
})
